package design.princible.demo3;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author wenhao hu
 * @title: Computer
 * @projectName design
 * @description: TODO
 * @date 2022/2/1811:14
 */
@Data
@AllArgsConstructor
public class Computer {
    AbstractCpu cpu;
    AbstractMemory memory;
    AbstractHardDisk hardDisk;

    public void run(){
        System.out.println("computer is running....");
        cpu.compute();
        memory.save();
        hardDisk.save();
        System.out.println("hardDisk.read() = " + hardDisk.read());
    }
}
